DEFINITION MODULE Program;
(*      File name: Program.def                                               *)
(*      Creation : Auguest 1985                                              *)
(*      Function : Create and terminate a proccess                           *)
(*      By       : Morris Djavaheri                                          *)
(*                                                                           *)
(*
*    Copyright (c) 1985,1986,1987,1988,1989 by
*    ana-systems, Foster City, California.
*    All Rights Reserved.
*
*    This software is furnished under a license and may be used and copied
*    only  in accordance with  the  terms  of  such  license and  with the
*    inclusion of the above copyright notice.  This software or  any other
*    copies thereof may not be provided or otherwise made available to any
*    other  person.   No title to and ownership of the  software is  herby
*    transferred.
*
*    The information in this software is  subject to change without notice
*    and  should  not be construed as a commitment by ana-systems.   No
*    warranty is implied or expressed.
*
*   SCCID  = "1.3    10/8/86"; 
*)
(*      Modifcation History                                                  *)
(*      Date            Who             Why                                  *)
(*                                                                           *)
FROM SYSTEM IMPORT ADDRESS;
EXPORT QUALIFIED 
   CallResult, ARGC,ARGSTRING,
   Call ,Terminate, Spawnl;

TYPE 
   CallResult = ( normalReturn,         (* program terminate normally *)
                  programHalt,          (* halt executed              *)
                  keyboardHalt,         (* Termintate by user break (^C*)
                  missingProgram,       (* Subprogram not found       *)
                  missingModule,        (* Library module not found   *)
                  duplicateModule,      (* Duplicate Librayr module names *)
                  versionError,         (* Moduler version error        *)
                  codeError,            (* Code I/O Erorr or bad structer *)
                  programCheck,         (* Range, arith,storage,string,..*)
                  ioError,              (* User I/O error *)
                  noProcess,            (* No more process is allowed *)
                  noMemory,             (* Not enought memory of the process *)
                  unkownError           (* unkown error *) );

  PROCEDURE ARGSTRING (ac :CARDINAL): ADDRESS;

  PROCEDURE Call ( VAR programName : ARRAY OF CHAR;
                   VAR callResult  : CallResult);
  
  PROCEDURE Terminate (reason : CallResult);

  PROCEDURE Spawnl(VAR progname,arg0,arg1,arg2,arg3,arg4,arg5,arg6: 
                         ARRAY OF CHAR): CallResult;
  VAR
   ARGC : CARDINAL;
END Program.
